<script>
export default {
    data() {
        return {
            router: null
        }
    },
    watch: {
        $route: {
            deep: true,
            immediate: true,
            handler(newRoute) {
                this.router = newRoute
            }
        }
    },
    render() {
        let url
        if (this.router.params.data) {
            url = this.router.params.data
        }
        const height = document.documentElement.clientHeight - 94.5 + 'px'
        const style = {
            height: height,
            width: '100%',
            padding: '0 24px 24px 24px'
        }

        return (
            <div style={style}>
                <iframe
                    src={url}
                    frameborder="no"
                    style="width: 100%; height: 100%"
                    scrolling="auto"
                ></iframe>
            </div>
        )
    }
}
</script>
